package com.example.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 接收author.properties文件的值
 * Created by joe on 16-8-8.
 *
 * 代码解释:
 *  @ConfigurationProperties 加载 properties文件的配置,通过prefix属性指定properties的配置前缀,
 *      通过location指定properties文件的位置
 */
@Component
@ConfigurationProperties(prefix = "author",locations = {"classpath:config/author.properties"})
public class AuthorSettings {
    private String name;
    private Long age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getAge() {
        return age;
    }

    public void setAge(Long age) {
        this.age = age;
    }
}
